<?php
/**
 * Created by Allen.
 * Date: 15-10-12
 * 抽奖码模型
 */

class Code_model extends HS_Model {

    
    //编辑
    public function editCode($where,$data)
    {
    	return $this->where($where)->edit($data);
    }
    
    //添加
    public function addUser($data)
    {
    	if ($this->add($data))
    	{
    		return $this->db->insert_id();
    	}
    }
    
    //随机获取验证码
    //获取单个
    public function checkCode($where=array(), $limit='1', $order_by='rand()')
    {
    	return $this->where($where)->limit($limit)->order_by($order_by)->find();
    }
} 
?>